Fixed problems when copying mutexes