errors class, misc fixes