Enhanced test cases so they pass under different JVMs