cleanup string parser, correct errors in backslash escaping