Fixed a bunch of bugs in the benchmark app, though something is still fishy because it's reporting implausibly high throughput.