Fix two mem corruptions.

Closes github issue #176