Fixed race condition around termination requests