Changed Ruby 2 code.