Fixed bug where max connections semaphore wasn't released when only 1 client is connected