replace.c: use the ref transaction functions for updates