There are a number of places where the code would be cleaner with a ref which returned its argument.
lgtm
Committed revision 5238.