Fix remote id.
Fix warning.
Cleanup and write the branch tip to the mailbox when syncing a branch.