Made compatiable with Python 2.