correct variable mismatch

The variable `$aliased` was referenced in error.

Slight reorganisation whilst fixing that to also prevent the short plugin alias logic from overwriting existing aliases.