Improve compatibility with Python 2.6.
Fix Travis build configuration.