Fixed some nullptr bugs