Fix unit test for reference functions