Corrected bug where I wasn't initializing semaphores correctly