more bugfixes for bug #296

The first fix was incomplete.  Haste makes waste.