Fixes several leaks to the global scope.

Perhaps a port to coffeescript could prevent these. ;-)