Fixing compile issues when compiling against Java 1.6 - 7