Fix basename issues