added subhist, improved warnings