Support ?type=directory.
Fix stat values.