Fixed using internal ID for DB updated operations.

Use the DB ID when doing updates instead of the internal ID.

(cherry picked from commit d871bc972a4294d0b3ee66eb87a87a811b890659)