Fixed null warnings from compiler