Resolve memory leak with result of factoryDefaults()

Fix issue #222