Fixed issues with complex-alias where aliased entities were not add
  to list of aliased entities used and alias level function was not added