Preprocessing of references, not really tested.