Fix possible empty list error after filtering errors