Correcting bug when generating strings in Parser.java