Make code compliant with Java 1.6