Fixed bugs in grammar and removed left recursion