Modified Database insert and update methods.