Fixed Hibernate issues