Corrects case/when syntax issue for ruby 1.9 upgrade