Replaced Ruby 2.0 specific code to compatibled with Ruby 1.9