montana_ruby_wrap: create functor only when needed (fix problems with resetting oRes value), minor cleanup