Misc Fixes around the Mlock pull request

See commit messages for details