Fix for HADOOP-7489

Its time someone fixed this. This fixes https://issues.apache.org/jira/browse/HADOOP-7489