Last fixes to make testsuite work on JDK8