Code

Final touches to fix query editing. It should work now.