diff --git a/.github/workflows/ruby.yml b/.github/workflows/ruby.yml
index 92aea7a..d0e4a81 100644
--- a/.github/workflows/ruby.yml
+++ b/.github/workflows/ruby.yml
@@ -22,7 +22,7 @@ jobs:
     strategy:
       fail-fast: false
       matrix:
-        ruby-version: ['2.5', '2.6', '2.7', '3.0']
+        ruby-version: ['2.5', '2.6', '2.7', '3.0', '3.1', truffleruby-head]
 
     steps:
     - uses: actions/checkout@v2
@@ -42,7 +42,7 @@ jobs:
     - name: Set up Ruby
       uses: ruby/setup-ruby@v1
       with:
-        ruby-version: 2.7
+        ruby-version: '2.5'
         bundler-cache: true # runs 'bundle install' and caches installed gems automatically
 
     - name: Run standardrb
diff --git a/debian/changelog b/debian/changelog
index 4445c11..6cbd41f 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,9 @@
+ruby-toml-rb (2.1.2-1) UNRELEASED; urgency=low
+
+  * New upstream release.
+
+ -- Debian Janitor <janitor@jelmer.uk>  Wed, 16 Mar 2022 14:27:49 -0000
+
 ruby-toml-rb (2.1.0-1) unstable; urgency=medium
 
   * Team upload.
diff --git a/debian/patches/0001-Use-system-libs.patch b/debian/patches/0001-Use-system-libs.patch
index 1426e4e..9b866c2 100644
--- a/debian/patches/0001-Use-system-libs.patch
+++ b/debian/patches/0001-Use-system-libs.patch
@@ -9,10 +9,10 @@ Forwarded: not-needed
  test/helper.rb | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
 
-diff --git a/test/helper.rb b/test/helper.rb
-index 34c4245..c399dee 100644
---- a/test/helper.rb
-+++ b/test/helper.rb
+Index: ruby-toml-rb/test/helper.rb
+===================================================================
+--- ruby-toml-rb.orig/test/helper.rb
++++ ruby-toml-rb/test/helper.rb
 @@ -1,2 +1,2 @@
  require "minitest/autorun"
 -require_relative "../lib/toml-rb"
diff --git a/lib/toml-rb/dumper.rb b/lib/toml-rb/dumper.rb
index cd26c7e..fca16c4 100644
--- a/lib/toml-rb/dumper.rb
+++ b/lib/toml-rb/dumper.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
 require "date"
 
 module TomlRB
@@ -53,7 +55,7 @@ module TomlRB
     def dump_simple_pairs(simple_pairs)
       simple_pairs.each do |key, val|
         key = quote_key(key) unless bare_key? key
-        @toml_str << "#{key} = #{to_toml(val)}\n"
+        @toml_str += "#{key} = #{to_toml(val)}\n"
       end
     end
 
@@ -91,10 +93,12 @@ module TomlRB
         obj.strftime("%Y-%m-%dT%H:%M:%SZ")
       elsif obj.is_a?(Date)
         obj.strftime("%Y-%m-%d")
-      elsif obj.is_a? Regexp
+      elsif obj.is_a?(Regexp)
         obj.inspect.inspect
-      elsif obj.is_a? String
+      elsif obj.is_a?(String)
         obj.inspect.gsub(/\\(#[$@{])/, '\1')
+      elsif obj.is_a?(Array)
+        "[" + obj.map(&method(:to_toml)).join(", ") + "]"
       else
         obj.inspect
       end
diff --git a/lib/toml-rb/version.rb b/lib/toml-rb/version.rb
index 037d2a9..8a1b502 100644
--- a/lib/toml-rb/version.rb
+++ b/lib/toml-rb/version.rb
@@ -1,5 +1,5 @@
 # frozen_string_literal: true
 
 module TomlRB
-  VERSION = "2.1.0"
+  VERSION = "2.1.2"
 end
diff --git a/test/dumper_test.rb b/test/dumper_test.rb
index ccbff82..ff4f9ef 100644
--- a/test/dumper_test.rb
+++ b/test/dumper_test.rb
@@ -29,6 +29,9 @@ class DumperTest < Minitest::Test
     dumped = TomlRB.dump(array: [[1, 2], %w[weird one]])
     assert_equal("array = [[1, 2], [\"weird\", \"one\"]]\n", dumped)
 
+    dumped = TomlRB.dump(array: %w[#$ #@ #{}])
+    assert_equal("array = [\"\#$\", \"\#@\", \"\#{}\"]\n", dumped)
+
     dumped = TomlRB.dump(time: Time.utc(1986, 8, 28, 15, 15))
     assert_equal("time = 1986-08-28T15:15:00Z\n", dumped)
 
diff --git a/test/grammar_test.rb b/test/grammar_test.rb
index 05beb53..6bc8a86 100644
--- a/test/grammar_test.rb
+++ b/test/grammar_test.rb
@@ -18,24 +18,24 @@ class GrammarTest < Minitest::Test
     indentation_alternatives_for("[akey]") do |str|
       match = TomlRB::Document.parse(str, root: :table)
       assert_equal(TomlRB::Table, match.value.class)
-      assert_equal(["akey"], match.value.instance_variable_get("@dotted_keys"))
+      assert_equal(["akey"], match.value.instance_variable_get(:@dotted_keys))
     end
 
     match = TomlRB::Document.parse("[owner.emancu]", root: :table)
     assert_equal(%w[owner emancu],
-      match.value.instance_variable_get("@dotted_keys"))
+      match.value.instance_variable_get(:@dotted_keys))
 
     match = TomlRB::Document.parse('["owner.emancu"]', root: :table)
     assert_equal(%w[owner.emancu],
-      match.value.instance_variable_get("@dotted_keys"))
+      match.value.instance_variable_get(:@dotted_keys))
 
     match = TomlRB::Document.parse('["first key"."second key"]', root: :table)
     assert_equal(["first key", "second key"],
-      match.value.instance_variable_get("@dotted_keys"))
+      match.value.instance_variable_get(:@dotted_keys))
 
     match = TomlRB::Document.parse("[ owner . emancu ]", root: :table)
     assert_equal(%w[owner emancu],
-      match.value.instance_variable_get("@dotted_keys"))
+      match.value.instance_variable_get(:@dotted_keys))
 
     assert_raises Citrus::ParseError do
       TomlRB::Document.parse("[ owner emancu ]", root: :table)
@@ -48,8 +48,8 @@ class GrammarTest < Minitest::Test
       assert_equal(TomlRB::Keyvalue, match.value.class)
 
       keyvalue = match.value
-      assert_equal("key", keyvalue.instance_variable_get("@dotted_keys").first)
-      assert_equal("value", keyvalue.instance_variable_get("@value"))
+      assert_equal("key", keyvalue.instance_variable_get(:@dotted_keys).first)
+      assert_equal("value", keyvalue.instance_variable_get(:@value))
     end
 
     indentation_alternatives_for('key1."key2".key3 = "value"') do |str|
@@ -57,10 +57,10 @@ class GrammarTest < Minitest::Test
       assert_equal(TomlRB::Keyvalue, match.value.class)
 
       keyvalue = match.value
-      assert_equal("key1", keyvalue.instance_variable_get("@dotted_keys")[0])
-      assert_equal("key2", keyvalue.instance_variable_get("@dotted_keys")[1])
-      assert_equal("key3", keyvalue.instance_variable_get("@dotted_keys")[2])
-      assert_equal("value", keyvalue.instance_variable_get("@value"))
+      assert_equal("key1", keyvalue.instance_variable_get(:@dotted_keys)[0])
+      assert_equal("key2", keyvalue.instance_variable_get(:@dotted_keys)[1])
+      assert_equal("key3", keyvalue.instance_variable_get(:@dotted_keys)[2])
+      assert_equal("value", keyvalue.instance_variable_get(:@value))
     end
   end
 
@@ -207,11 +207,11 @@ class GrammarTest < Minitest::Test
   def test_expressions_with_comments
     match = TomlRB::Document.parse("[shouldwork] # with comment", root: :table)
     assert_equal(["shouldwork"],
-      match.value.instance_variable_get("@dotted_keys"))
+      match.value.instance_variable_get(:@dotted_keys))
 
     match = TomlRB::Document.parse("works = true # with comment", root: :keyvalue).value
-    assert_equal("works", match.instance_variable_get("@dotted_keys").first)
-    assert_equal(true, match.instance_variable_get("@value"))
+    assert_equal("works", match.instance_variable_get(:@dotted_keys).first)
+    assert_equal(true, match.instance_variable_get(:@value))
   end
 
   def test_array