Fix some deprecations with Rails4