Minor changes on semaphores.