Bug Fixes

fixed issue #21
fixed issue #22