Fixed bugs found in the Transformer, with regards to sorting metadata.