A few bug fixes from failing tests; still leaky.