Fixing issues when compiling against Java 1.6