Add some benchmarks, fix some bugs