Fix various compilation warning with jdk7.