Fixing some bugs I introduced in last-minute changes.

These should be squashed into the previous commit prior to merge.