Some various tweaks and fixes