Fixed bug with python 2.5 where double quotes were not escaped properly