Fixing compile warnings about signed/unsigned comparisons. Fixed subtle error where we were trying to assign a negative value to an unsigned integer. Removed the use of "new" for some 2D arrays and used our own DataArray<> template class instead.