Fixed all .to_a and production errors