fix div by 0
restructure subsort checking, avoid sort inference
use base factory during typesmart constructor evaluation