Small fixes for Python 2.4
Merge pull request #1192 from lamblin/fix_py24

Small fixes for Python 2.4