Change refes and add a test.