Correctly handle global var creation