Fixed some nullpointers