Almost get tedit working sane again