Yet another fix for TEXT FILES. Ugly but should work