Fixed the layout shift issue in patch #2. Please review.