Fixed code breaking in Rails 3.