Fixed issues preventing use with Ruby 1.8