Java 6 Compatibility

Fixed to work with Java 6