Fixed initial max_sum to set as the first element of the array to cover the case if all elements in the array are negative.