Some Python 2.6 problems fixed