Fixed some issues with Python 2.6