add tests on map iter, fix an edge case causing segfault