Remove redundant filename checks.