Fix invalid cast exception when generating tooltip for sigs