Fix amibuous rte/var bug. Tweaks still needed.