Fix tests failure on ruby 1.8