Made the rake task work and better support Active Record