Merge in Brian's latest tweaks and improvements, mostly just
to stay somewhat in sync with what he's doing.