Fixed a nullpointerexception.