fix a couple of bugs
Merge pull request #53 from l1ll1/master

fix a couple of bugs