Fixed bugs in pull request.