put in additional sox refinements, handle some errors