Replaced translate() with replace() to fix python 3.2 compatibility