Issue 142

As I mention in the commit log, I believe this is the appropriate fix (with test) for issue #142. I have only tested the new test and not the others. Would someone please run the full test suite with these changes and confirm the fix doesn't cause other test failures?