I just fixed the problems you spotted, plus all the other instances of those problems but........
I still get the problem I originally reported, it is now on line 147.
I had hoped I was just seeing some obscure knock on effect, sadly not.
Why would an object need to be a reference in order to be passed by reference? It is the compiler's job to generate a reference to the passed value. If a numeric literal is passed to a procedure then clearly it cannot be a Ref parameter. Anything else can be because they take up a memory chunk which can be pointed to. A string literal, or anything else, has to live somewhere, that somewhere has an address, that address can be passed as a reference.
Maybe they don't do it in commercial languages, but in real time languages it is not unheard of to specifically have a "constant " qualifier for reference parameters (or whatever the specific language calls them) so that the compiler can trap assignment to the parameter as an error, thus allowing structured contants to be efficiently handled. So, yes, in some languages, a literal string can be passed by reference, just because it is efficient.
But anyway, I digress.
Back to the thread......
The problem is still there, despite sundry corrections.
P.S. What makes you think us old time real timers are obsessive about efficiency? LOL