more nil checks
Merge pull request #28 from ScotterC/more-nil-checks

More nil checks