This is a fix for Python wrapping using Python 3. The for loop on a dictionary has been rewritten in a more generic way (compatible with python 2 and 3).