Fix tight loop on studio unload caused by recent development