Fix legacy_ctrl_to_param() to pay better attention to keytype