Fixes target names not being updated on change, reduces some duplicated code
Modified real name update check slightly
Merge pull request #1457 from fleure/clownshoes

Fixes target names not being updated on change, reduces some duplicated ...