Protect agains out of range index
Add InitialSessionState.Providers support