Merge pull request #354 from rattoma/master

several bug fixes for cluster computations
Fixed bug introduced in commit c9402d9ecc1d063a96e583d82a07028aeadc49eb for local threads