Fixed a bug with Query namespace and run_as_service().