fixes across precalculus to conform against new test data and regressions introduced during refactoring