Fixed a NPE
Reverted part of my 'Fix a NPE' commit
Merge pull request #1 from mbilker/master

Merged request from mbilker which fixes a NullPointerException.