Possible fix for #5

I guess I encountered the situation depicted in the report, and the following fixes it.