Fixed some bugs (validate, clear, etc), optimized numLeaves, added animMode to demo