Add Python 2 compatibility