More fixes for Rails 4.