some fixes and upgrades