fix some bugs
Merge pull request #2 from kbond/patch-2

fix some bugs