Fix an off by one error when running hooks in bulk update and delete. Closes #2054