general: minor fixes

A suite of minor bug fixes.