further bug fixes for Rails 3