Fixed file locking.