Fix dependencies for Java 8 compatibility.