minor fixes to emits and queries