Compatibility with Rails 4
Code review fixes from mitio
Merge pull request #6 from dorner/master

Compatibility with Rails 4