Fixed issues discussed in the pull request