various fixes and txt mode better