Fixed trimming and corrected the counter of uncompleted tasks.