More fixes to the formula parser and new test cases