Properly deallocation of memory

cppcheck found a few invalid deletes - should be delete [] for arrays.