Some small fixes and upgrades