Fix regression for Python 2