Caret fixed
Caret now moves to correct position. This also fixes autoscroll of the console.