Fix compatibility with jdk 1.6