Merge "Move hover rejection to an earlier part of the function" into main