count directories as files (fixes #607)