Fix currentTaskIndex on remove