Add python3 and python2.5 compatibility