Rails 4 compatibility

Fixes #4