Fixed basename bug