Fixed semaphore for q2. Various changes.