** Fixed couple of problems with jpa metamodel