Merge PR #38
Add tests for behavior PR #38 fixes

Huge thanks to @dabooze for being patient while we sorted out the
fiasco with the regression from several months ago and fixed this
up. So glad that this has been resolved now.