Fixes issue #15

Includes test case