Fix bugs, add benchmarks and change value type