Fixed bug in Python 2.