Fixes compilation issues on java 8 jdk