Fix using wrong delete operator to tidy up arrays