Fix #111.

When comparing targets, check if the target is a standard target.
Implement chain.replace_rule()