Fixed nullpointerexception.