Various fixes. Made division query toggleable by a button, because it
was slow.