Bug fix for python2 < 2.7.5