Patched race condition in director. Should add same for other destructors. Should add test.