Fixing multiply-evident memory corruption (closes #9)