Fixed count_only bug