Fixed bugs. Added benchmarks.