Fixed a bug in clean_fname() that could sometimes leave a "dir/.."