#935 - Prevent stack overflow on metadata creation with cyclical classes