Minor enhancements to some queries