Minor fix to remove_reference