Fixed calculation of slab buffer size for flexible potentials.