fixed a few bugs and race conditions in customer project (a password manager)