Fix improperly encoded ids.