Fixes Bug 905346: fix cut/paste errors in query