fix compatibility issues with Java 1.6