Fixed a NPE
Updated to Java 7