If I had to guess without seeing the subs, I'd think you're probably dealing with parameter corruption. Remember -- subs can pass values BACK as well as receive them.
SUB foo (x$)
x$ = "cheese"
END SUB
Doesn't matter what x$ was before the call to foo above -- it's cheese afterwards!
To preserve the variable without changing it:
SUB foo (passedX$)
x$ = passedX$ 'local use, non-return variable
x$ = "cheese"
END SUB
In the above, we assign our passed value to a local variable and work with that variable. No matter how much it changes in SUB, it never affects the value of the original.