Bug in exchange variation calculation in certain situations