Fixed globals() and updated locals()