Various fixes for Hadoop 2