Fix a memory corruption

Fixes #5.