Various cleanup

See individual commit comments; there is no overall theme to this set.