Improved clean_field function.