Fix the bug with adding ref to parameters when it shouldn't be there.