Fixes to be able to run on Glassfish.