Fix loading with OpenSearchLayer in some corner cases