Fix map iterator loop