Changed to use recursive locks to allow for command self-calls.