Fixed getting basetype and restricted type.