diff --git a/libraries/liblber/debug.c b/libraries/liblber/debug.c
index 277eecae630f7b8c7ce8e5cb0fd69c2a8ea6dfa7..cc38e85b44919e4b08d40e4ead4b3ff153caab4a 100644
--- a/libraries/liblber/debug.c
+++ b/libraries/liblber/debug.c
@@ -62,8 +62,9 @@ void (lutil_debug)( int debug, int level, const char *fmt, ... )
 	}
 #endif
 
+	sprintf(buffer, "%08x ", time(0L));
 	va_start( vl, fmt );
-	vsnprintf( buffer, sizeof(buffer), fmt, vl );
+	vsnprintf( buffer+9, sizeof(buffer)-9, fmt, vl );
 	buffer[sizeof(buffer)-1] = '\0';
 	if( log_file != NULL ) {
 		fputs( buffer, log_file );
diff --git a/servers/slapd/overlays/accesslog.c b/servers/slapd/overlays/accesslog.c
index d01c70d0675211895bf959df2e04dc3c4a4d3184..4023e18b1496320a9716c5a2faf98568c01dbaae 100644
--- a/servers/slapd/overlays/accesslog.c
+++ b/servers/slapd/overlays/accesslog.c
@@ -2110,6 +2110,7 @@ accesslog_db_root(
 		AttributeDescription *ad = NULL;
 		const char *text = NULL;
 		Entry *e_ctx;
+		BackendDB db;
 
 		e = entry_alloc();
 		ber_dupbv( &e->e_name, li->li_db->be_suffix );
@@ -2154,7 +2155,8 @@ accesslog_db_root(
 			}
 			be_entry_release_rw( op, e_ctx, 0 );
 		}
-		op->o_bd = li->li_db;
+		db = *li->li_db;
+		op->o_bd = &db;
 
 		op->ora_e = e;
 		op->o_req_dn = e->e_name;
@@ -2162,7 +2164,6 @@ accesslog_db_root(
 		op->o_callback = &nullsc;
 		SLAP_DBFLAGS( op->o_bd ) |= SLAP_DBFLAG_NOLASTMOD;
 		rc = op->o_bd->be_add( op, &rs );
-		SLAP_DBFLAGS( op->o_bd ) ^= SLAP_DBFLAG_NOLASTMOD;
 		if ( e == op->ora_e )
 			entry_free( e );
 	}
diff --git a/tests/scripts/test063-delta-multimaster b/tests/scripts/test063-delta-multimaster
index af043057dd7e399ba6492325fbc4e555585c3989..61438d5e9ea28b0cd5d6082cf151eaf101f953fb 100755
--- a/tests/scripts/test063-delta-multimaster
+++ b/tests/scripts/test063-delta-multimaster
@@ -42,7 +42,7 @@ case "$SYNCMODE" in
 		SYNCTYPE="type=refreshOnly interval=00:00:00:03"
 		;;
 	rp)
-		SYNCTYPE="type=refreshAndPersist"
+		SYNCTYPE="type=refreshAndPersist interval=00:00:00:03"
 		;;
 	*)
 		echo "unknown sync mode $SYNCMODE"
@@ -288,8 +288,26 @@ if test $RC != 0 ; then
 	exit $RC
 fi
 
-echo "Waiting $SLEEP1 seconds for syncrepl to receive changes..."
-sleep $SLEEP1
+THEDN="cn=James A Jones 2,ou=Alumni Association,ou=People,dc=example,dc=com"
+sleep 1
+for i in 1 2 3; do
+	$LDAPSEARCH -S "" -b "$THEDN" -H $URI1 \
+		-s base '(objectClass=*)' entryCSN > "${MASTEROUT}.$i" 2>&1
+	RC=$?
+
+	if test $RC = 0 ; then
+		break
+	fi
+
+	if test $RC != 32 ; then
+		echo "ldapsearch failed at slave ($RC)!"
+		test $KILLSERVERS != no && kill -HUP $KILLPIDS
+		exit $RC
+	fi
+
+	echo "Waiting $SLEEP1 seconds for syncrepl to receive changes..."
+	sleep $SLEEP1
+done
 
 n=1
 while [ $n -le $MMR ]; do
@@ -353,7 +371,6 @@ n=`expr $n + 1`
 done
 
 echo "Using ldapmodify to force conflicts between server 1 and 2..."
-THEDN="cn=James A Jones 2,ou=Alumni Association,ou=People,dc=example,dc=com"
 $LDAPMODIFY -D "$MANAGERDN" -H $URI1 -w $PASSWD \
 	>> $TESTOUT 2>&1 << EOF
 dn: $THEDN