sub-type handling (ugh) and various fixes