Compute element types and resolve alternative references.

Signed-off-by: Etienne M. Gagnon <egagnon@j-meg.com>