Fix table_utils.map and add regression test