Unit test for the cutoff date and a fix