Fix the reference entities for the download