Do not use delete operator when deallocating objects.

This seems to fix some issues reported by Valgrind.