Improves handling and assignment of default units
When creating a material without specifying units, no units are
currently assigned. This commit will assign the default units when none are
given, or throw an error when incompatible units are given. In the
latter case, the units are set to the property defaults.
This commit also incidentally fixed an issue when saving the material that
resulted in accessing an uninitialized pointer.