Convert IDs to the correct types.