Key exchange fixes