Fix jdk8/intellij errors and warnings.