Fixed removing and undoing of tasks