Fix removing semaphore