Fixed some bugs.
Merge pull request #5 from ex1st/master

Fixed some bugs.