Fix bug preventing data from being replaced in a DB table