Fixed the file descriptors of the semaphore to be instantiated correctly