Switched to Java 6 and a few corrections