Fix compilation if ref used in bench