Added public access to managedObjectModel method.
Added check to avoid crash when object is not of class type RHManagedObject.