Remove wrong limit parameter from count query in compatibility function