bugs in formulas fixed