A few fixes and improvements

Five assorted fixes and improvements; all should be included in the next dbuild release.