Fix lots of things

Disregard the other pull requests; this fixes lots of things.  Pick whatever you feel is appropriate.