Issue #632 Fixed locking file after opening (cannot save, etc.)