Bug fix for a regression in recent chnages

Bug fix for a regression I introduced accidentally in my recent changes. Was not covered by specs--have now added specs so it doesn't happen again.