Add alias to imports when returning

addition to #2723 fixing issue #2642