Merge $405 and #406

Snuck in two additional commits of my own,  107a2d8 and 3bd012b and thoroughly checked everything.  There are still some minor problems, but we can fix those separately.