Fix output and error check of benchmark script
Fix error handling of benchmark script
Fix type in perf.rb