Fixed bug for empty parenthesis. Added the corresponding test cases.