Improve Python 3 Compatibility