Fix horizontal scrolling and text highlighting