Checking if late_flag is 0 before defaulting it

Refer to: http://manage.dimagi.com/default.asp?142358#797925
i think as a rule we use brackets in JS even if it's a one-liner.