Fixed a nullpointer exception.