Fixed Rails 3 compatibility.