Fix tests that failed after switching HibernateGormStaticApi to use @CompileStatic

Fix tests that failed after switching HibernateGormStaticApi to use @CompileStatic. I noticed a few @CS bugs that needed some workarounds.