Improve compatibility with Python 2.5 (for Windows build)