Fixed some small bugs gh-iss2 not resolved.
Resolved github-iss2.