fixes to smart parens mode