fix some bugs caused by latest variant type changes