Fixed lingering lock issues resulting from refactoring errors