Made changes from old pull request.