Lots of fixes. Sync almost there