Various tweaks and fixes here and there