Fixed a couple of bugs in map reduce and the java client