Fixed a bug in the clean_input code