Improved references handling.