Fix several bugs. Small tests run through now. On bigger formulas most likely still buggy.