Fixed logic to detect if file should be skipped.