Fix lock / unlock calls