Fixed #1944. Don't know how pathname is being merged from Ruby 2.1