Another thing is that mIRC hates 0 as it will at times treat it as $null
You could try replacing the 0 if it is there with $chr(48) which is 0