a series of minor fixes.