Fixed parens in substring and trim.