Improve TMX metadata handling