Fixed issues for running in production with Rails 4