Update with changes suggested by @otfrom.