Fixes error when setting global flags.