Added ability of runtime editing of "pre-exit-hook" value
Fixed the bug with infinite pre-exit-hook executing