Bug in query execution from structure