Fixed the metric listener so it records task endings.