Last fixes to make testsuite work on JDK8

With this fixes testsuite runs as it should on JDK8.
There is still few test failures on jdk8, but that is different story