Fix for null reference in certain reference parsing situations