Remove invalid inputs.