minor fixes and refinements