Add rails 4 compatibility and #1