Fixed dupe error caused by aliases

Would only happen if you duped an entity with renamed inputs/outputs
which didn't have aliases registered. Thanks to Dokkter for reporting
this problem.

Fixes #673