Added bookkeeping to some value replacements, argument replacements still needs to be tracked.