Fixes for Rails 3