Changed clean_fname() to take a flag int instead of a BOOL. Added