Changed to only check properties if the instance is an object
Changed to honor format and pattern for non-string values, and corrected validation messages
Removed 'instance' as propertyPath root, and changed to handle missing required properties consistently