Add benchmarking code
Fix the error reporting when running the tests