Static variable handling now works correctly