Fix issue with count of returned rows