Don't panic on queries for nonexistent folders (fixes #765)