Performed according to review at pull request and added tests.