Fix issues for Rails 4. Rails 3 is no longer supported