More minor mods and cleanups to main