bug fixes, style upgrades