taint2: Fix a few memory corruption bugs.