Fix database repair collection; add save/close to database; start writing network IO