harden gc script against unexpected files