several fixes and adjustments