Checked for the name when looking for a key in globals.

I see this is quite an old project but I'm using it regardless and I noticed...

The original code doesn't seem quite correct in that it is checking for the globals as a key of globals and then throwing an exception saying that name doesn't exist.  Checked for name instead.