Fixes/locking

Fix various issues with locking and scale out, including #49