Fixed some bugs.
Merge pull request #8720 from sonsongithub/master

Fixed some bugs.