Checking if late_flag is 0 before setting it, because 0 is a falsey value
Merge pull request #4604 from dimagi/fix-late-flag

Checking if late_flag is 0 before defaulting it