MAPREDUCE-735. Fixes a problem in the KeyFieldHelper to do with the end index for some inputs. Contributed by Amar Kamat.