Fixing subtle bug in pool.map call