Proper handling of parentheses