Rails 2.x

Here are the fixes for rails 2.x, could you create another branch called rails_2.x so that it doesn't affect your master branch, thanks.