This fixes issue #27
This fixes issue #20