Fix warnings and convert to java 8 where possible