Rails 4 compatibility

Little change to make it compatible with Rails 4.