Fix parsing comments and unbalanced brackets in strings.