Bug fixes and sync