Trying to fix really strange behaviour on open JDK8