Fixed warnings when upgrading code to Java 1.8 from 1.6