Fixed a case with shaders where an object is spawn to ensure the parent is correctly set.