Add add_semicolon_if_needed function.  Call it.