More robust adjustment to ruby 2.x