Fix multiple locking issues.  Closes CID #1020958