Tweaks, fixes, refactors