Rails 4 Hacks, Fixes

For the issue #1963