fixes for Rails 4 compatibility

This seems to work for me in a Rails 4.0.2 app I am building.