Fixed recursive directory scan