Extract `die` for testing.

See #232.