small adjustments for python 2.7