ActiveRecord 3 fixes