various tweaks and fixes