fix several delete/delete[] mismatches