Add user control over what happens if a constant is already present.

Fix for #2043.