XD-1996 Tightening null checks