Fixed a bunch of deprecation notices after rails 4 update.