Pass obj with lock by reference. 


Two methods that did not touch their received value are made into functions.

 Fixes "lock passed by value" issues raised by "go vet".