Fix some cases were ArrayRefs were being passed by reference.
Simplify creation of a bunch of ArrayRefs by using None, makeArrayRef or just letting them be implicitly created.