Fixed bug with ref and const-ref function parameters