Fix directory scanner to correctly ignore files without d_type