Fix problems with java 8