Fixed bug when iterating on dynamic maps