Fix to key constructor