fix handling of unterminated quote at end of string