Add workaround for https://bugs.ruby-lang.org/issues/8083 bug