small fixes and refinements