Fix optimizations that force new queries even for already loaded data