Merge "Slightly cleanup KeyParameter error handling."