fix map/reduce query
more tests