Fixes for Python 2.6, 3.2, 3.3, and 3.4