Bugfix to dual decomposition