py: Fix iteration over map in 2 places.