Fixed bugs with the program to text conversion