Add the reference handling.