Fixed error in behavior.select. The partial sums are needed to make the optimal move