Minor tweaks to remove unnecessary deep copies.