Fix for object class validation

Fix for issue: https://github.com/realm/realm-cocoa/issues/1225