Fixed problem with serialization of models