Fix bugs.
Merge pull request #474 from nZEDb/dev

Fix bugs.