Fixed minor error with mutex unlocking