Fixed stats computation, so that remote CTS texts don't break the query