RM: File locking fix