fix bugs in analysis of type of tuple element with aliases and unions