Made some updates to account for Python 3 language changes