Potential fix for issue #15

This fix seems to address the issue, but may have unintended consequences.  I haven't been unable to create a test case that breaks it yet.