Fix the mechanism via which query_spec works