Additional safety check implemented for generic models.