Moved a few objects to unique_ptr

This code now does a different thing than the comment above it suggests. Fix the comment.