Important fix to toFile(), added ExternalText class