Fix decimal conversion for Python 2.6