Bug fixes.
Merge pull request #26 from ivanzhaowy/master

Bug fixes.