Switch from Java 7 to Java 6
Fix some compiler warnings