Fix bugs in benchmark tool