Improvements to enclosed reference handling