Removed some redundant logic and code.
Removed a redundant lock.