Fixes global variables