Stats query fix.