Jmoldow mainview bugfix

It looks like these commits already made it into main (with different commit hashes -- probably as a result of a cherry-pick -- so git doesn't think this branch is merged yet).

I'm "merging" this for the sake of the record and deleting the branch.