Checking if late_flag is 0 before defaulting it

Refer to: http://manage.dimagi.com/default.asp?142358#797925