Move resolveAlias usage appropriately to get the proper key for checking if container has an existing instance.