Fix issue with uninitialised globals in a way which works in both versions