Fix missplaced selection box in some situations