Fixed NPE from ParaPenguin/SporkPGM#29

Just a little fix from #29 :D