Fix basename check.