Fix a nasty bug that was causing miscompilation of global variables