fix issues pointed out in pull request