fixes for Python 2.7.1 (OSX 10.7.5)