Fixes for JDK1.8

Allow compilation with JDK8