Type_factory: fixed a segfault caused by situations when we can't determine the mimetype