Fix python 2.x compatibility