Added logic to dectect malformed expression, non-matching parenthesis and commas without parenthesis