More work to make it Ruby 1.8.7 compatible