Fix test errors on Rails 4.