Changes based on PR feedback, misc cleanup and fixes.