Fix standard profile code for Python 3.1