Fix TypeError exception raised by Ruby 2.0.