Python 3 dictionary iteration fixes.

Change-Id: I9ef3f210d631e8ec86853fcc3c58d66af28d62ec