Bug fix, recursive mutex calls to lock.