Fix semaphore