correct substitute itself constraint detection (closes #4281)