Fixed some null pointers