Use 'with' keyword for locking
Fixed some older function calls to use 'live' client