Some Fixes

fixed gh-14
fixed gh-15
fixed gh-13