Fix 1.9.2 problems

case/when has changed a bit in ruby 1.9.2.  this fixes it!