Fix TypeError when 'properties' are checked against non-object