Fixed bug when the base dir is more than one level deep