Some more null checks added