more fixes and style upgrades