Fix value error in Python2.6