Bugfix for issue 11 with syncing immediately after connecting.

This fixes #11.