Improvements to multiple formulas

See commit messages for details.