Tidied up global scope code.
Fixed typo on name.