Misc enhancements

See individual commits for more details.