Fix null reference in figure referencing.