assorted minor bugfixes