fixed some bugs
Merge pull request #1 from huip/master

fixed some bugs