safety build in helpersmath and also fixed a bug found.