Fixed flag on replace