Fixes for python2.6 and python3.3