Added test for github issue #45
Fixed github issue #45