Fixed issue #6

Checking for null is a good idea most of the time.