Fixed unit tests following code refactoring for persistent model objects. Found and fixed code errors while fixing tests