Fix Rails 4 deprecation warnings

Fixes #77