Rails 3 compatibility fixes