Fix two errors with Ruby 1.9.3 and Rails 3.2