Fix Thread and Semaphore Start/Stop Logic