bug fixes
Merge pull request #50 from Yaliang/master

bug fixes