Fix const and ref passing.

Change-Id: I1077ab20b13b5f2f4590759d00fffefb2e7ec1e9