Updated db branch functions
Fixed up total_replace