Fix errors in Folder queries