various small fixes and tweaks