Fix segfault, though from now on, each new object has to #include Material.h and take care of destruct its material pointer.