Added checks on global objects to make sense. Fixes #1