backport compatibility.rb from RC2