Bug fixes.

The malloc->calloc change here was particularly tricky to catch.
I kept seeing correct behavior due to, I suppose, randomly pre-zeroed
memory.