Improve Hadoop 2.x compatibility