improve reference handling for line debug state