Fix match_key_order to not return `false` when the key is invalid.
* Also fix spec for get_valid_mappings.