Changes to be Rails 4 compatible