Fix to https://github.com/iipc/openwayback/issues/101 with unit test.

See https://github.com/iipc/openwayback/issues/101