Added some synchronized statements to deal with concurrency.
Reworked the Benchmark tests.