Complemented dir scan, fixed to compile with recent compiler.