Corrected document unlocking (closes #3953)