Mods to make tests pass and clean up deprecations for Rails 4.