Fixed nullpointers