Semaphore fixes.