Fixed cursor getting stuck on left and right borders.