session & TTY error handling cleanup fixes