Fix compilation errors under java 8