Added addFormat() for registering custom formats
Corrected validateSchema() to ensure instance is object for complex types