Fixed using internal ID for DB updated operations.

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