fix most filetype issues. intersect still raises error with empty files.