Benchmark tests and fixes