Fixed Rails4 deprecations