bugfixes; All tests seem to work on Python 2.5 and 2.7