Fix validation of custom objects