I never had a problem with Win9x logins, of course each script is fairly unique.

When KiXtart exits it should release memory and clean up automatically, with the exception of COM automation objects which may hang around - you should explicitly clear/close these if you have any.

My guess is that it is a timing issue, and your extra code to clear down the variables is delaying the script long enough so that the problem does not appear.

I've seen similar problems with scripts that run asynchronously, or mess about with the Z: drive mapping.