Fix basename bug