This is identical to what was formerly clean_input_keys...