ctor: Set pointers to NULL before allocation.

This way, the dtor can work correctly.