Fixed a minor bug concerning a nullpointerexception.