Fixed another memory leak: array of arrays for neighbor distances was not properly deallocated, forgot to delete subarrays