Fix bug 3228, faulty calculation in the problem.