bug fixes
Merge pull request #41 from Yaliang/master

bug fixes