Minor fix in the py conversion code