Adding additional fixes for Rails 4.