Review fix for locking logic
Review fixes for unit tests