Clean up a few more unneeded copies, make things a bit more const-correct