added `exit_reason::as_string`
fixed possible bug in sync messaging

this patch fixes a possible bug caused by uninitialized variables