Improved view finding to make queries work correctly