Issue #25 and fixes issue #23