Fix a bug where sync was sent before the first message.