Fixed bug in table handling and removed redundant parentheses