Merge pull request #509 from ZappoMan/bug_fixes

fix several delete/delete[] mismatches