Fixed a few nullexceptions