various bits and pieces

This is a collection of several smaller changes, additions and fixes that
mostly came up while experimenting and working on other things.