Robustify file input