Adapt code to make it compatible with Hibernate ORM 4.2.7.SP1
Revert log improvement: cause of NPEs