Rails 4.1 fixes

These two lines are required for Rails 4.1 to work and don't break backward compatibility.