Fix mode to be a string for Ruby 2