More file locking cleanup and consolidation