Fix check_queues_count