Fixed issues with Rails 4.0