deep copy fix for maxsum library