fixes issues pointed out in PR