Added error handling for references with huge amounts of associated data.