various fixes and adjustments