Fixed sending health after level ends, and modified socket closing