Fix date comparison (bug 951425)