Use data[] instead of data.chars[]. Fix some other Ruby 1.9.3 issues.