Some improvements to clean_file_path() function.