Improve patch and init functions

- Reset isImporting value at start-up
- Fixing cases where patching password is not necessary