Add debugging information for get_task_count