Fixed differences so it can be used with JDK7.