Fixed an issue in which the wrong dictionary was updated.

Added benchmarking code.