Fix file locking
Merge commit '032754dce6cb45a4d4ba0a01da2e3a4d8e5cbad5'