Completely rewrote syncing, much better now, fixed a few bugs.