fix incorrect type aliasing logic