Null handling fix