Fix bug in DIY basename by simply using basename command.