Added some null checks that cause NPEs
Merge pull request #11 from andylyall/2014.03

Added some null checks that cause NPEs