Fix bugs.
Merge pull request #1 from 3xian/master

Fix bugs.