Finished fixes for Rails 4 and Ruby 2 upgrades