Rails 4 fixes