Patch for issue #366

Since this is a feature change, it's up to the maintainer to decide whether to merge this or to close #366 as Won't Fix.