Build arrays as needed.

Closes #248.