Fixing a bug in the previous commit

We're not allowed to nest function calls which all use the mutex construction.