Minor changes for python 3 and 2.6+ support.