Fix incorrect dependencies being added on task insert