rebased ruby 2.1-head patches