Further changes following @wilsonpage's review.