Trying to resolve hibernate bugs