Fixed some bugs in UniType class.