Fixed a nullreference exception being thrown(at least, i think so)