Misc. changes

Hi,

There's a bunch of misc. changes made here.  I don't expect you'll just blindly merge them.  But if any seem interesting to you, please let me know and I'll pull out to a topic branch.