Bug fixes for caret movement towards the right.