A fix for fiddly on_query_completions code regression in 3009