[SOLVED] Comparison operator flags null that shouldn't be there

Right enough.
I think I’d try defining all your global var as Number types.