fixed issue #193
fixed issue #199
Merge pull request #204 from kirisetsz/master

monkey fix to #193 and #199