Fix the 'if' clause to be true under the right conditions. Bug #6126