Fixed a nasty chicken-egg problem in the AnimatedMesh class.
Also correted a logical error in there.