Fix compatibility problem with Ruby 2.x (check compatiblity with 1.8.7-p374, 1.9.3, 2.1.1)