Modifications based on the comments on PR 126.