Added a few type checks for some of the C functions in the bench.rb tool.