fixes issue #94. Fixes issue #95