issue #20212: Make sure lock is renewed on save and other misc. fixes.