Change modes to strings for Ruby 2.X compatibility