Fix test failures (only occurred with JDK 1.7)