Merge "Correctly preserve key generation parameters" into pi-dev