Fixed mapreduce function & docs