Fixing hibernate issues.