Equation bugfixes