Why is ``replaceTargets`` called from two places?