Rails 4 updates plus some old fixes that were in my master