494 fix spatial globals

fix for #494 also fixing some of the issues of #493 which I closed and removed the branch.

right now I'm realizing you probably meant that you wanted the commits to have the issue number on it not the pull request.