This fixes #8185.  It now does the division by two immediately, instead of last.