Minor tweaks, code cleanup