fix __getattr__ for variables

__getattr__ now correctly returns variables from the global scope.