Actually, I copied the code directly from Olivier's contribution, but I don't know if it is correct to do that for all servers, so I'd welcome Olivier's comments too.