Fixed python2.6 & python3 compatability