Fix addition of references