Fix in semaphores and Test