bug fixes
Merge pull request #29 from Yaliang/master

bug fixes