Fixed #2 -> delete [] instead of delete.