Made code Python 3.2 compatible.