fixed compare_file_basenames bug and improved tests