#24, sem_wait usage fix