This fixes issue 5797 and allows replace using timestamps