fix minor bugs in runtime.rb