fix a nullpointerexception
Fix a few crashes