Some work to clean up references (still much work to be done).