Changed TERM to xterm as screen-256colors was interfering with ssh.