Fixed several uninitialized array bugs
Misc. cleanup; bug fixes to mesh motion.