fixes from Carl H for a couple of buglets