Backport "bouncing cow" fix from more recent release