Improve material batching to only evaluate time-dynamic attributes.

Also some other minor fixes.