Rails 4 upgrade fixes.