Use struct size rather than hard-coded constant for allocation of static tm structs.

Fixes issue #1600.