fix minimization errors