Remove null and undefined properties before validation.