fix some issue with parentheses management.