Fix lock and states. closes #2630