It seems that everything is fine in the end except essential singularities inside the contour. Former-commit-id: 9fe7135cb30d1fff1dc3ff9bf8a9152c6b0ef9b4