Fixed sorting on ruby 1.8