Fix jumbled element references