Unneeded index flush was removed
(cherry picked from commit 6aa31e8)
Safe memory mode was added.
(cherry picked from commit db406ae)
Merge remote-tracking branch 'origin/hotfix-1.6.1' into hotfix-1.6.1