fixes issue #125
fixes issue #129
Fixes issue #128