Fixes to benchmarking code
Fixed a few issues in the runtime support