Fixed severe allocation problems with non-pointer wrapped types.

* Added calls to C++ constructor and destructor.
* Updated the stub generation script to do proper initializations.