Fix ifdef, replace server disconnect to work variant