Change from reduce to inject for ruby 1.8.5 compat