fixed a bug where NULL values mess up reduceResults