Fixed bug where double array sum always returns int