Fix a bunch of bad ActiveRecord use